namespace DeZhen.CollaborationPlatform.Model.DTO.ApiCallLog
{
    /// <summary>
    /// 接口调用日志DTO
    /// </summary>
    public class ApiCallLogDTO
    {
        /// <summary>
        /// 日志ID，主键
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 关联的接口ID,关联api_management表id字段
        /// </summary>
        public long? ApiId { get; set; }

        /// <summary>
        /// 接口URL
        /// </summary>
        public string? ApiUrl { get; set; }

        /// <summary>
        /// 请求方法(GET/POST/PUT/DELETE等)
        /// </summary>
        public string? ApiMethod { get; set; }

        /// <summary>
        /// 请求唯一标识
        /// </summary>
        public string? RequestId { get; set; }

        /// <summary>
        /// 客户端IP
        /// </summary>
        public string? ClientIp { get; set; }

        /// <summary>
        /// 用户代理
        /// </summary>
        public string? UserAgent { get; set; }

        /// <summary>
        /// 用户ID(未登录为null)
        /// </summary>
        public string? UserId { get; set; }

        /// <summary>
        /// 请求参数(JSON格式)
        /// </summary>
        public string? RequestParams { get; set; }

        /// <summary>
        /// 请求体内容
        /// </summary>
        public string? RequestBody { get; set; }

        /// <summary>
        /// 请求时间(精确到毫秒)
        /// </summary>
        public DateTime? RequestTime { get; set; }

        /// <summary>
        /// 响应状态码
        /// </summary>
        public int? ResponseCode { get; set; }

        /// <summary>
        /// 响应体内容
        /// </summary>
        public string? ResponseBody { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        public string? ErrorMessage { get; set; }

        /// <summary>
        /// 执行耗时(毫秒)
        /// </summary>
        public int? ExecutionTime { get; set; }

        /// <summary>
        /// 服务器IP
        /// </summary>
        public string? ServerIp { get; set; }

        /// <summary>
        /// 状态：1-成功，0-失败
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }
    }
}